package com.gg.fmallspringboot.controller;

import com.gg.fmallspringboot.model.Result;
import com.gg.fmallspringboot.service.impl.WCPayServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作者:Miki
 * 时间:2021/6/20 22:56
 */
@RestController
@RequestMapping("/wx-pay")
@CrossOrigin("*")
public class WCPayController {

    @Autowired
    private WCPayServiceImpl wcPayService;

    @GetMapping("/orderWXPay")
    public Result wxPay(String orderId){
        //根据订单id在数据库中查询需要支付的金额，订单的状态(是否已支付)

        wcPayService.unifiedorder(orderId,1,"接受微信支付回调结果的地址，成功修改订单状态");
        return null;
    }
}
